package cn.jingyinghui.testreactor;

import reactor.core.publisher.Flux;

import java.util.function.Consumer;

public class MyFirstReactor {
    public static void main(String[] args) {

        Flux<String> flux = Flux.just("Hello", "Reactor", "World!");


        flux.subscribe(
                data  -> System.out.println("接收数据: " + data),
                error -> System.err.println("发生错误: " + error),
                () -> System.out.println("流处理完成!")

        );




    }


    static  class MyConsumer implements Consumer<String> {
        @Override
        public void accept(String s) {
            System.out.println("111");
        }
    }


}
